<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
selection_test(
    '<div contenteditable>foo<br>^bar<div>|baz</div></div>',
    selection => {
        assert_own_property(window, 'textInputController',
            'this test requires window.textInputController.');
        selection.document.addEventListener('textInput', () => {
            // disconnect the node here
            const focusNode =  selection.focusNode;
            focusNode.parentNode.removeChild(focusNode);
        });
        textInputController.setMarkedText('1', 0, 1);
        textInputController.insertText('x');
    },
    '<div contenteditable>foo<br><div>b|az</div></div>',
    'InsertText frame invalidation by disconnecting anchor and focus node on textInput event');
</script>

